import fetchAsync from './async';

export default {
  
  namespace: 'two',

  state: {
    value: 0,
  },

  subscriptions: {
    setup({ dispatch, history }) {  // eslint-disable-line
      console.log('two subscriptions setup run');
    },
  },

  effects: {
    *increment({ payload }, { call, put }) {  // eslint-disable-line
      console.log('two effects increment run');
      // yield call(fetchAsync, { state: });
      // yield put({ type: 'save' });
    },
    *decrement({ payload }, { call, put }) {  // eslint-disable-line
      console.log('two effects decrement run');
    },
  },

  reducers: {
    save(state, action) {
      console.log('two reducers save run');
      return { ...state, ...action.payload };
    },
  },
}